{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "a57c2ede",
   "metadata": {},
   "source": [
    "### 课本练习"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a688a54c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Don't panic!\n",
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "on\n",
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "on tap\n"
     ]
    }
   ],
   "source": [
    "phrase = \"Don't panic!\"\n",
    "plist = list(phrase)  \n",
    "print(phrase)\n",
    "print(plist)\n",
    "\n",
    "\n",
    "on_str = ''.join(plist[1:3])\n",
    "print(on_str)\n",
    "new_phrase = on_str+ ''.join(plist[5]+plist[4]+plist[7]+plist[6])\n",
    "print(plist)\n",
    "print(new_phrase)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "88d0b54f",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
